FindCodec
TheFindCodec
function allows you to determine which of the installed compressors or decompressors has been chosen to field requests made using one of the special compressor identifiers.Some Image Compression Manager functions allow you to specify a particular compressor component. For example, you may use the
codec
parameter to
theCompressSequenceBegin
function (described on page 3-110) to specify a particular compressor to do the compression.You identify the compressor to the Image Compression Manager by specifying the compressor's component identifier (see the description of the
GetCodecNameList
function on page 3-57 for information on retrieving these identifiers).The Image Compression Manager also supports several special identifiers that allow you to exert some control over the component for a given action without having to know its
identifier.
pascal OSErr FindCodec (CodecType cType, CodecComponent specCodec, CompressorComponent *compressor, DecompressorComponent *decompressor);
cType
- Specifies a compressor type. You must set this parameter to a
valid compressor type (see Table 3-3 on page 3-59 for a list of the available compressor types).specCodec
- Contains a special identifier value. You must set this parameter to one of the following special identifier values:
anyCodec
- Choose the first compressor or decompressor of the specified type
bestSpeedCodec
- Choose the fastest compressor or decompressor of the specified type
bestFidelityCodec
- Choose the most accurate compressor or decompressor of the specified type
bestCompressionCodec
- Choose the compressor that produces the smallest resulting data
compressor
- Contains a pointer to a field to receive the identifier for the compressor component. The Image Compression Manager returns the identifier of the compressor that meets the special characteristics you specify in the
specCodec
parameter. Note that this identifier may differ from the value of the field referred to by thedecompressor
field. The Image Compression Manager sets this field to 0 if it cannot find a
suitable compressor component. Set this parameter tonil
if you do not want this information.decompressor
- Contains a pointer to a field to receive the identifier for the decompressor component. The Image Compression Manager returns the identifier of the decompressor that meets the special characteristics you specify in the
specCodec
parameter. Note that this identifier may differ from the value of the field referred to by thecompressor
field. The Image Compression Manager sets this field to 0 if it cannot find a suitable decompressor component. Set this parameter tonil
if you do not want this information.DESCRIPTION
You can use theFindCodec
function to obtain the identifier of the component that is being used to field requests made with one of the special compressor identifiers.RESULT CODES
n oErr
0 No error paramErr -50 Invalid parameter specified memFullErr -108 Not enough memory available noCodecErr -8961 The Image Compression Manager could not find the specified compressor